<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../css/api.css" />
		<link rel="stylesheet" type="text/css" href="../../css/style.css" />
		<style type="text/css">
			.detial_news{ background-color: #fff; padding: 15px;}
			.detial_news h1{ display:block; font-size: 17px; font-weight: 400; line-height: 25px; color: #333;}

			
			.detial_news .con { font-size: 15px; color: #333; line-height: 25px;}
			.detial_news .con img{ width:100%; margin-bottom: 5px;}
			.detial_news .con p{ padding-bottom:15px;}
			.sk-three-bounce {
			  margin: 0 auto;
			  width: 80px;
			  text-align: center; }
			  .sk-three-bounce .sk-child {
				width: 13.5px;
				height: 13.5px;
				background-color: #3262F1;
				border-radius: 100%;
				display: inline-block;
				-webkit-animation: sk-three-bounce 1.4s ease-in-out 0s infinite both;
						animation: sk-three-bounce 1.4s ease-in-out 0s infinite both; }
			  .sk-three-bounce .sk-bounce1 {
				-webkit-animation-delay: -0.32s;
						animation-delay: -0.32s; }
			  .sk-three-bounce .sk-bounce2 {
				-webkit-animation-delay: -0.16s;
						animation-delay: -0.16s; }

			@-webkit-keyframes sk-three-bounce {
			  0%, 80%, 100% {
				-webkit-transform: scale(0);
						transform: scale(0); }
			  40% {
				-webkit-transform: scale(1);
						transform: scale(1); } }

			@keyframes sk-three-bounce {
			  0%, 80%, 100% {
				-webkit-transform: scale(0);
						transform: scale(0); }
			  40% {
				-webkit-transform: scale(1);
						transform: scale(1); }
			}
			
		</style>
	</head>
	<body>
		<!--详情页start-->
		<div class="detial_news" id="result">
			<ul class="con" id="conflist">
				
			</ul>
			<script id="conflist_template" type="text/template">
			  {{=it.content}}
			</script>
		</div>
		<!--详情页end-->
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/app.js"></script>
	<script type="text/javascript" src="../../script/doT.js"></script>
	<script type="text/javascript">
		var UILoading;
		apiready = function() {
			api.parseTapmode();
			UILoading = api.require('UILoading');
			$api.css($api.byId('result'), 'display: none');
			showloading();
			getJsonFromAPI();
			api.addEventListener({
                name: 'navitembtn'
            }, function(ret, err) {
                if (ret.type == 'left') {
					api.closeWin({
					});
                }
            });
		}
		function getJsonFromAPI() {
			//从接口获取查询数据
			api.ajax({
				url: ApiUrl + '/v1/conflist/goodterms',
				method: 'get',
				cache: false,
				timeout: 10,
				headers: {
					//authorization: kAppKey+';'+userinfo.access_token+';'+userinfo.uid
				}
			}, function(ret, err) {
				hideloading();
				$api.css($api.byId('result'), 'display: block');
				if (ret) {
					var newsdetail = ret;
					UpdateList('conflist','conflist_template',newsdetail);

				} else {
					if(err.statusCode == '0')
					{
						toast('网络异常，请保持网络连接后重试');
					}
					else
					{
						toast('系统异常');
					}
				}
			});

		}
		//渲染数据
		function UpdateList(domId,templateId,jsondata) {
			console.log(JSON.stringify(jsondata));
			var act_content = $api.byId(domId);
			var tempFn = doT.template($api.byId(templateId).innerHTML);
			var resultText = tempFn(jsondata);
			$api.html(act_content, resultText);
			api.parseTapmode();
		}
	</script>
</html>